package com.aorise.mapper.order;

import com.aorise.model.order.WorkOrderAddVO;
import com.aorise.model.order.WorkOrderModel;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
* @Author:cat
* @Description 运维工单mybatis接口类
* @Date:Created in 2019-05-29
* @Modified By:
*/
@Mapper
@Component(value = "WorkOrderMapper")
public interface WorkOrderMapper {
    /**
     * @Author:cat
     * @Description 根据设备ID查询维修记录信息
     * @params: map 查询条件Map
     * @Date:2019-05-29
     * @Return: List<WorkOrderModel> 维修记录集合
     * @Modified By:
     */
    List<WorkOrderModel> getWorkOrderBycameraId(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:psl
     * @Description 新增运维工单信息
     * @params: WorkOrderModel 运维工单信息
     * @Date:2019-05-31
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer addWorkOrder(WorkOrderAddVO workOrderAddVO) throws DataAccessException;

    /**
     * @Author:psl
     * @Description 查询运维工单信息总条数
     * @params: map 查询条件Map
     * @Date:2019-06-03
     * @Return: Long 数据总条数
     * @Modified By:
     */
    Long getAllWorkOrderListTotalByPage(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:psl
     * @Description 分页查询运维工单信息
     * @params: map 查询条件Map
     * @Date:2019-06-03
     * @Return: List<WorkOrderModel> 点运维工单集合
     * @Modified By:
     */
    List<WorkOrderModel> getAllWorkOrderListByPage(Map<String, Object> map) throws DataAccessException;


    /**
     * 查询最后一条运维工单
     * @return
     */
    WorkOrderModel selectWorkOrder();
}